Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Configuration variable editor (WIP) #449

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jamesread
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Nov 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitroom ❌ Failed (Inspect) Nov 26, 2024 9:20am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
postiz ⬜️ Ignored (Inspect) Visit Preview Nov 26, 2024 9:20am


const form = useForm({ resolver, values: { message: '' } });

const [state, setState] = useState(true);

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'state' is assigned a value but never used.

Copilot Autofix AI 2 days ago

To fix the problem, we need to remove the unused state variable and its associated useState hook. This will eliminate the ESLint error and make the code cleaner and more efficient.

  • Remove the const [state, setState] = useState(true); line from the code.
  • Ensure that any other references to state or setState are also removed, although in this case, there are none.
Suggested changeset 1
apps/frontend/src/components/settings/configuration-variable-editor.component.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/frontend/src/components/settings/configuration-variable-editor.component.tsx b/apps/frontend/src/components/settings/configuration-variable-editor.component.tsx
--- a/apps/frontend/src/components/settings/configuration-variable-editor.component.tsx
+++ b/apps/frontend/src/components/settings/configuration-variable-editor.component.tsx
@@ -18,3 +18,2 @@
 
-  const [state, setState] = useState(true);
 
EOF
@@ -18,3 +18,2 @@

const [state, setState] = useState(true);

Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@jamesread
Copy link
Collaborator Author

Screenshot of WIP;

image

At the moment, the settings are not "saved", but I need support from @nevo-david to tell me if I am doing this idiomatically correctly, or not, because I've never written react code before.


setState(cvars);
return cvars;
}, [])

Check warning

Code scanning / ESLint

verifies the list of dependencies for Hooks like useEffect and similar Warning

React Hook useCallback has a missing dependency: 'fetch'. Either include it or remove the dependency array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant